Skip to content

[Enhancement] - Enable passing of requestMetadata to the Bedrock Converse API. #4110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

StuartLox
Copy link

@StuartLox StuartLox commented Aug 10, 2025

Description

Currently, SpringAI does not expose a way to pass custom requestMetadata to the Bedrock Converse API.

AWS Bedrock allows including requestMetadata in requests so that additional contextual information can appear in Bedrock audit logs in CloudWatch.

This is particularly useful for tracing requests, where correlation IDs, user session IDs, or other operational tags are required for audit and compliance purposes.

See RequestMetadata in Converse API here: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html

Proposed Change

This change leverages the metadata field from the user prompt Object to provide a mechanism to set the requestMetadata parameter in the ConverseAPI Request.

@StuartLox StuartLox force-pushed the feature/bedrock-converse-request-metadata branch from ca2a531 to 8f89a11 Compare August 10, 2025 13:41
@StuartLox StuartLox changed the title [Enhancement] - Add requestMetadata to converse request [Enhancement] - Enable passing of requestMetadata to the Bedrock Converse API. Aug 10, 2025
Copy link
Contributor

@sunyuhan1998 sunyuhan1998 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@StuartLox StuartLox force-pushed the feature/bedrock-converse-request-metadata branch 2 times, most recently from a75a707 to 142d5dc Compare August 11, 2025 11:14
@StuartLox StuartLox requested a review from sunyuhan1998 August 11, 2025 11:14
@StuartLox StuartLox force-pushed the feature/bedrock-converse-request-metadata branch from 5e37932 to ff85ea1 Compare August 11, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants